<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="修改创建申请单" bodyClass="white-bg" libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">

    <@form.form id="form-sale-edit"  class="form-horizontal">
    <h4 class="form-header h4"><@ctx.i18n text = "基本信息"/></h4>
    <input name="id" value="${bpmCrmSaleorder.id}" type="hidden">

    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "订单号"/>：
    </label>
        <div class="col-sm-8"><input name="saleCode"  value="${bpmCrmSaleorder.saleCode?default("")}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售员" />：
        </label>
        <div class="col-sm-8"><input name="salePerson" value="${bpmCrmSaleorder.salePerson?default("")}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售组" />：
        </label>
        <div class="col-sm-8"><input name="saleTeam" value="${bpmCrmSaleorder.saleTeam?default("")}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售经理" />：
        </label>
        <div class="col-sm-8"><input name="saleManager" value="${bpmCrmSaleorder.saleManager?default("")}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "订单状态"/>：</label>
        <div class="col-sm-8" >
            <!--            <@form.select name="saleStatus" dictType="sys_sale_status"  blankValue="${bpmCrmSaleorder.saleStatus}" />-->
            <select name="saleStatus" class="form-control m-b" readonly="true" disabled>
                <#list dict.getType('sys_sale_status')>
                <#items as d>
                <#if d.status =='0' >
                <option  value="${d.dictValue}" text="${d.dictLabel}" <#if d.dictValue==(bpmCrmSaleorder.saleStatus+'')?default("") >selected = "selected"</#if>>${d.dictLabel}</option>
        </#if>
    </#items>
</#list>
</select>
</div>
</div>
<h4 class="form-header h4"><@ctx.i18n text = "客户信息"/></h4>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户名称" />：
    </label>
    <div class="col-sm-8"><input name="saleCustomername" value="${(bpmCrmSaleorder.saleCustomername+'')?default("")}" class="form-control" type="text"  readonly="true" required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户地址" />：
    </label>
    <div class="col-sm-8"><input name="saleAddress" value="${bpmCrmSaleorder.saleAddress?default("")}" class="form-control" type="text"  readonly="true" required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户手机号" />：
    </label>
    <div class="col-sm-8"><input name="salePhone" value="${bpmCrmSaleorder.salePhone?default("")}" class="form-control" type="text"  readonly="true" required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户邮箱" />：
    </label>
    <div class="col-sm-8"><input name="saleEmail" value="${bpmCrmSaleorder.saleEmail?default("")}" class="form-control" type="text"  readonly="true" required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "客户微信" />：
    </label>
    <div class="col-sm-8"><input name="saleWechat" value="${bpmCrmSaleorder.saleWechat?default("")}" class="form-control" type="text"  readonly="true" required>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "ID"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="saleId" dictType="sys_sale_id" value="${bpmCrmSaleorder.saleId?default('')}"  readOnly="true"/>
    </div>

</div>
<div class="form-group jiazhao">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "驾照" />：
    </label>
    <!--            <input name="saleDriverlicense" value="${bpmCrmSaleorder.saleDriverlicense?default("")}" class="form-control" type="text" >-->
    <div class="col-sm-8">
        <!--            <input name="saleDriverlicense" value="${bpmCrmSaleorder.saleDriverlicense?default("")}" class="form-control" type="text" >                -->
        <div class="layui-upload">
            <!--                <button type="button" class=" layui-btn" id="choiceList"><i class="iconfont icon-e645"></i>选择多文件</button>-->
            <!--                <button type="button" class="btn btn-success btn-sm" id="jiazhaoList" disabled><i class="fa fa-upload"></i> 上传驾照</button>-->
            <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>文件名</th>
                        <th>大小</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="demojiazhaoList">
                    <tr id="upjiazhaoload"> </tr>
                    <#list dllist as item>

                    <tr id="upload${item_index}">
                        <td>  ${item.fileName?default("")}  </td>
                        <td> ${item.fileSize?default("")}   </td>
                        <td>上传成功</td>
                        <td>
                            <!--                                <button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" disabled>删除</button>-->
                        </td>
                    </tr>
                    <!--                        </tr>-->
                    </#list>
                    </tbody>
                </table>
            </div>
            <div class="layui-form-item layui-btn-Center">
                <div class="layui-input-block text-right">
                    <!--                        <button type="button" class="layui-btn layui-btn-xs" id="jiazhaoListAction" disabled>开始上传</button>-->
                    <!--                        <button class="btn layui-btn layui-btn-xs layui-btn-primary js_close" id="huzhaoXiao" type="button">取消</button>-->
                </div>
            </div>
        </div>
    </div>
</div>
<div class="form-group huzhao">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "护照" />：
    </label>
    <div class="col-sm-8">
        <!--            <input name="salePassport" value="${bpmCrmSaleorder.salePassport?default("")}" class="form-control" type="text" >-->
        <!--            <input name="saleDriverlicense" value="${bpmCrmSaleorder.saleDriverlicense?default("")}" class="form-control" type="text" >                -->
        <div class="layui-upload">
            <!--                <button type="button" class=" layui-btn" id="choiceList"><i class="iconfont icon-e645"></i>选择多文件</button>-->
            <!--                <button type="button" class="btn btn-success btn-sm" id="huzhaoList" disabled><i class="fa fa-upload"></i> 上传护照</button>-->
            <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>文件名</th>
                        <th>大小</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="demohuzhaoList">
                    <tr id="uphuzhaoload"> </tr>
                    <#list dllist as item>

                    <tr id="uploadhuzhao${item_index}">
                        <td>  ${item.fileName?default("")}  </td>
                        <td> ${item.fileSize?default("")}   </td>
                        <td>上传成功</td>
                        <td>
                            <!--                                <button class="layui-btn layui-btn-xs layui-btn-danger demo-delete" disabled>删除</button>-->
                        </td>
                    </tr>
                    <!--                        </tr>-->
                    </#list>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "房产"/>：</label>
    <div class="col-sm-8" readonly="true" disabled="">
        <@form.radio name="saleResidenceinfo" id="saleResidenceinfo" dictType="sys_sale_resi" value="${bpmCrmSaleorder.saleResidenceinfo?default('')}"  readOnly="true"/>
    </div>

</div>
<div class="form-group ssn">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "SSN"/>：
    </label>
    <div class="col-sm-8"><input name="orderCustomerSsn" value="${bpmCrmSaleorder.orderCustomerSsn?default("")}" class="form-control" type="text"  readonly="true">
    </div>
</div>
<div class="form-group i20">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "I-20"/>：
    </label>
    <div class="col-sm-8">
        <div class="layui-upload">
            <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th>文件名</th>
                        <th>大小</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="demoList">
                    <tr id="upload"> </tr>
                    <#list i20list as item>
                    <tr id="uploadi20${item_index}">
                        <td>  ${item.fileName?default("")}  </td>
                        <td> ${item.fileSize?default("")}   </td>
                        <td>上传成功</td>
                        <td>
                        </td>
                    </tr>
                    </#list>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="remark" class="form-control"  readonly="true">${bpmCrmSaleorder.remark?default("")}</textarea>
    </div>
</div>

<!--    <div class="form-group">-->
<!--        <label class="col-sm-3 control-label"><@ctx.i18n text = "创建人" />：-->
<!--        </label>-->
<!--        <div class="col-sm-8"><input name="userId" value="${bpmCrmSaleorder.userId?default("")}" class="form-control" type="text"  readonly="true">-->
<!--        </div>-->
<!--    </div>-->
<#if bpmCrmSaleorder.saleStatus!=0>
<h4 class="form-header h4"><@ctx.i18n text = "合同信息"/></h4>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "合同价格"/>：
</label>
    <div class="col-sm-8"><input name="orderContractPrice" value="${bpmCrmSaleorder.orderContractPrice?default("")}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "是否包含税"/>：</label>
    <div class="col-sm-8">
        <!--  <@form.radio name="orderIsTax" dictType="sys_yes_no" value="${bpmCrmSaleorder.orderIsTax?default('')}" /> -->
        <#list dict.getType('sys_crm_yesno')>
        <#items as d>
        <div class="radio-box">
            <input type="radio" id="orderIsTax" name="orderIsTax" value="${d.dictValue}"
            <#if d.dictValue == (bpmCrmSaleorder.orderIsTax+'')?default("") >checked</#if> readonly="true"/>
        <label for="${(d.id)?default('')}">${d.dictLabel}</label>
    </div>
</#items>
</#list>
</div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "是否包含运输费"/>：</label>
    <div class="col-sm-8">
        <!--  <@form.radio name="orderIsTransportFee" dictType="sys_yes_no" value="${bpmCrmSaleorder.orderIsTransportFee?default('')}" /> -->
        <#list dict.getType('sys_crm_yesno')>
        <#items as d>
        <div class="radio-box">
            <input type="radio" id="orderIsTransportFee" name="orderIsTransportFee" value="${d.dictValue}"
            <#if d.dictValue == (bpmCrmSaleorder.orderIsTransportFee+'')?default("") >checked</#if> readonly="true"/>
        <label for="${(d.id)?default('')}">${d.dictLabel}</label>
    </div>
</#items>
</#list>
</div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "是否保修"/>：</label>
    <div class="col-sm-8">
        <!--  <@form.radio name="orderIsWarranty" dictType="sys_yes_no" value="${bpmCrmSaleorder.orderIsWarranty?default('')}" /> -->
        <#list dict.getType('sys_crm_yesno')>
        <#items as d>
        <div class="radio-box">
            <input type="radio" id="orderIsWarranty" name="orderIsWarranty" value="${d.dictValue}"
            <#if d.dictValue == (bpmCrmSaleorder.orderIsWarranty+'')?default("") >checked</#if> readonly="true"/>
        <label for="${(d.id)?default('')}">${d.dictLabel}</label>
    </div>
</#items>
</#list>
</div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "其他"/>：
</label>
    <div class="col-sm-8"><input name="orderOtherItem" value="${bpmCrmSaleorder.orderOtherItem?default("")}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车辆识别码"/>：
</label>
    <div class="col-sm-8"><input name="orderCarVin" value="${bpmCrmSaleorder.orderCarVin?default("")}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车型"/>：
</label>
    <div class="col-sm-8"><input name="orderCarVehicle" value="${bpmCrmSaleorder.orderCarVehicle?default("")}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "车辆ID"/>：
</label>
    <div class="col-sm-8"><input name="orderCarIdentity" value="${bpmCrmSaleorder.orderCarIdentity?default("")}" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "合同生效日期"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control time-input" name="orderEffectTime"  data-type="date"   value="${(bpmCrmSaleorder.orderEffectTime?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text" readonly="true"/>
        </div>
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "描述"/>：
</label>
    <div class="col-sm-8"><input name="orderContractpriceRemark" value="${bpmCrmSaleorder.orderContractpriceRemark?default("")}" class="form-control" type="text" <#if bpmCrmSaleorder.saleStatus!=0>readonly="true"</#if>>
</div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：
</label>
    <div class="col-sm-8"><input name="orderContractpriceMoney" value="${bpmCrmSaleorder.orderContractpriceMoney?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text" <#if bpmCrmSaleorder.saleStatus!=0>readonly="true"</#if>>
</div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "应收总和"/>：
</label>
    <div class="col-sm-8"><input name="orderReceivableMoney" value="${bpmCrmSaleorder.orderReceivableMoney?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text" <#if bpmCrmSaleorder.saleStatus!=0>readonly="true"</#if>>
</div>
</div>
</#if>
<h4 class="form-header h4"><@ctx.i18n text = "信用卡信息"/></h4>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "实收总和"/>：
</label>
    <div class="col-sm-8"><input name="orderFactMoney" value="${bpmCrmSaleorder.orderFactMoney?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "期望价格/额度"/>：
</label>
    <div class="col-sm-8"><input name="orderHopePrice" value="${bpmCrmSaleorder.orderHopePrice?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text" readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "应收余额"/>：
</label>
    <div class="col-sm-8"><input name="orderReceivablePrice" value="${bpmCrmSaleorder.orderReceivablePrice?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text" readonly="true">
    </div>
</div>
<h4 class="form-header h4"><@ctx.i18n text = "业务成本信息"/></h4>
<h5 class="form-header h5"><@ctx.i18n text = "业务成本汇总信息"/></h5>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "类别"/>：</label>
    <div class="col-sm-8">
        <input name="costType" value="${bpmCrmSaleorder.costType?default("")}" class="form-control" type="text"  readonly="true">
        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 总额,库存,运输,维修,临牌,过户,报销,汇款,整备,退车,其他</span>
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "金额"/>：
</label>
    <div class="col-sm-8"><input name="costMoney" value="${bpmCrmSaleorder.costMoney?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text"  readonly="true">
    </div>
</div>
<h5 class="form-header h5"><@ctx.i18n text = "业务流程汇总信息"/></h5>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "流程类型"/>：</label>
    <div class="col-sm-8">
        <input name="processType" value="${bpmCrmSaleorder.processType?default("")}" class="form-control" type="text"  readonly="true">
        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 总额,库存,运输,维修,临牌,过户,报销,汇款,整备,退车,其他</span>
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "流程条数"/>：
</label>
    <div class="col-sm-8"><input name="processNumber" value="${bpmCrmSaleorder.processNumber?default("")}" class="form-control" type="text"  readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "流程进度"/>：
</label>
    <div class="col-sm-8"><input name="processProgress" value="${bpmCrmSaleorder.processProgress?default("")}" class="form-control" type="text"  readonly="true">
    </div>
</div>
<#if bpmCrmSaleorder.saleStatus!=0>
<h4 class="form-header h4"><@ctx.i18n text = "预览提成"/></h4>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "应收（实收）总和"/>：
</label>
    <div class="col-sm-8"><input name="previewReceivableSum" value="${bpmCrmSaleorder.previewReceivableSum?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text"  readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "目前成本"/>：
</label>
    <div class="col-sm-8"><input name="previewCurrentCost" value="${bpmCrmSaleorder.previewCurrentCost?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text"  readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "预计（最终）利润"/>：
</label>
    <div class="col-sm-8"><input name="previewHopeProfit" value="${bpmCrmSaleorder.previewHopeProfit?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text"  readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "预计（最终）业绩"/>：
</label>
    <div class="col-sm-8"><input name="previewHopeAchievement" value="${bpmCrmSaleorder.previewHopeAchievement?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text"  readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "提成比例"/>：
</label>
    <div class="col-sm-8"><input name="previewPercentage" value="${bpmCrmSaleorder.previewPercentage?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text"  readonly="true">
    </div>
</div>
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "预计（最终）提成"/>：
</label>
    <div class="col-sm-8"><input name="previewCommission" value="${bpmCrmSaleorder.previewCommission?default("")}" placeholder="￥" autocomplete="off" class="form-control" type="text"  readonly="true">
    </div>
</div>
</#if>
</@form.form>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "bpm/sale";
    $("#form-sale-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/edit", $('#form-sale-edit').serialize());
        }
    }

    //在插件中使用对象
    $.fn.upfile = function(type) {
        var upfile = new Upfile(this,'',$("input[name='saleCode']").val(),type);

        layui.use('upload', function() {
            var upload = layui.upload;
            var UplodeIn = upload.render(upfile.options);
            upfile.SetInst(UplodeIn)

        });

    };
    $("#jiazhaoList").upfile(1);
    $('#huzhaoList').upfile(2);

    function redioCallback(id,data,event){
        if(id=="saleId"){
            if ($(data).is(':checked')){
                var menuType = $(event.target).val();
                $(".huzhao").hide();
                $(".jiazhao").hide();
                if(menuType=="3"){
                    $(".huzhao").show();
                    $(".jiazhao").show();
                    return
                }
                if(menuType=="1"){
                    $(".huzhao").show();
                    return
                }
                if(menuType=="2"){
                    $(".jiazhao").show();
                    return
                }
            }
        }

        /**
         * 房产
         */
        if(id=="saleResidenceinfo"){
            if ($(data).is(':checked')){
                var menuType = $(event.target).val();
                $(".ssn").hide();
                $(".i20").hide();
                if(menuType=="3"){
                    $(".ssn").show();
                    $(".i20").show();
                    return
                }
                if(menuType=="1"){
                    $(".ssn").show();
                    return
                }
                if(menuType=="2"){
                    $(".i20").show();
                    return
                }
            }
        }
    }
</script>
</@footer>
</@pageTheme>
